﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BCDataCenter.DataAccessLayer;
using System.Web.UI.HtmlControls;

public partial class WebMaster_Administrator_BaseData_Default : System.Web.UI.Page
{
    string error = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ActiveViewIndex"] == null)
        {
            MultiView1.ActiveViewIndex = 0;
            Session["ActiveViewIndex"] = 0;
        }
        else
        {
            MultiView1.ActiveViewIndex = (int)Session["ActiveViewIndex"];
        }
        LoadData();
    }
    private void LoadData()
    {
        DAL obj = new DAL();
        //GridView1.DataSource = obj.MyExecuteReader(ref error, "GetListARSalePType", System.Data.CommandType.StoredProcedure);
        //GridView1.DataBind();
    }
    private void NewThongTinChung()
    {
        txtMaKenh.Text = "";
        CheckBoxDangHoatDong.Checked = false;
        txtTenKenh.Text = "";
        txtTenCongTy.Text = "";
        txtDiaChi.Text = "";
        txtDienThoai.Text = "";
        txtMaSoThue.Text = "";
        txtFileName.Text = "";
    }

    private void NewTonKho()
    {
        CheckBoxTinhGVNVR.Checked = false;
        CheckBoxTinhGVNVD.Checked = false;
        CheckBoxTinhGVNVC.Checked = false;
        CheckBoxKTraHT_CT.Checked = false;
        CheckBoxTinhGVSau.Checked = false;
        txtKhoHangLe.Text = "";
        CheckBoxDoiChieuIARGopKho.Checked = false;
        CheckBoxKhoaOPIkhilamIRA.Checked = false;
        CheckBoxDoiChieuTK_KhoaSo.Checked = false;
        CheckBoxSuaIRA.Checked = false;
        CheckBoxNhapIRAnhieuLan.Checked = false;
        CheckBoxQLyGomSPKhoLe.Checked = false;
        CheckBoxKhoDungNhieuKenh.Checked = false;
        CheckBoxPHBTheoKho.Checked = false;
        CheckBoxChoPhepMH_VuotTon.Checked = false;
        CheckBoxBanTheoLoc.Checked = false;
        CheckBoxLocTheoMHChinh.Checked = false;
    }

    protected void mnuKhaiBaoTTPPMoi_MenuItemClick(object sender, MenuEventArgs e)
    {
        if(e.Item.Value.Equals("ThongTinChung"))
        {
            MultiView1.ActiveViewIndex = 0;
            Session["ActiveViewIndex"] = 0;
        }
        else if (e.Item.Value.Equals("TonKho"))
        {
            MultiView1.ActiveViewIndex = 1;
            Session["ActiveViewIndex"] = 1;
        }
        else
        { 
        
        }
    }
    protected void btnNew_Click(object sender, ImageClickEventArgs e)
    {
        if (MultiView1.ActiveViewIndex == 0)
        {
            NewThongTinChung();
        }
        else if (MultiView1.ActiveViewIndex == 1)
        {
            NewTonKho();
        }
        else
        { 
        
        }
    }
}
